﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using F_MODEL;
using System.Data;
using System.Data.SqlClient;


namespace F_DAL
{
    public class Trans_dal
    {
        /// <summary>
        /// 中转站信息显示
        /// </summary>
        /// <returns></returns>
        public List<Mails> Tran_show(int id)
        {
            SqlParameter[] paramter ={
                               new  SqlParameter("@Userid",SqlDbType.Int){Value=id}
                               };
            SqlDataReader read = DbHelperSQL.RunProcedure("[dbo].[zhongzhuanzhan]", paramter);
            List<Mails> list = new List<Mails>();
            while (read.Read())
            {
                Mails us = new Mails();
                us.goodsImg = Convert.ToString(read["goodsImg"]);
                us.types1 = Convert.ToString(read["types1"]);
                us.mailId = Convert.ToString(read["mailId"]);
                us.mailIsDel = Convert.ToInt32(read["mailIsDel"]);
                us.mailTimeSpan = Convert.ToDateTime(read["mailTimeSpan"]);
                us.predictPrice = Convert.ToDecimal(read["predictPrice"]);
                us.receiveUser = read["receiveUser"].ToString();
                us.sendUser = read["sendUser"].ToString();
                us.stationId = Convert.ToInt32(read["stationId"]);
                us.stationName = Convert.ToString(read["stationName"]);
                us.dweight = read["dweight"].ToString();
                us.WorkMan = Convert.ToString(read["WorkMan"]);
                us.WorkManTel = Convert.ToString(read["WorkManTel"]);
                list.Add(us);
            }
            return list;
        }
    }
}
